function [ g ] = g_function( h )

global G_FUNCTION;
global BETA;
% G_FUNCTION Summary of this function goes here
%   Detailed explanation goes here

%if G_FUNCTION == 1  % Funcion escalon
%    g = sign(h);
%else
if G_FUNCTION == 1  % Funcion lineal
    g = BETA * h;
elseif G_FUNCTION == 2  % Funcion no lineal tanh
    g = tanh(BETA*h);            
else        % Funcion no lineal exp
    g = 1 ./ (1 + exp(-2.*h.*BETA));
end
            

end

